import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import './plugins/element.js';
import './icons'; // icon
import echarts from 'echarts';
import VCharts from 'v-charts';
import _ from 'lodash';
import xss from 'xss';
// import jquery from './utils/jquery';
// console.log(jquery,999);
// var $ = jquery;
// console.log($==jquery,888);
// 引入axios
import axios from './utils/request';
// 安装
Vue.prototype.axios = axios;
Vue.prototype.$echarts = echarts;
Vue.prototype.$_ = _;
Vue.prototype.$EventBus = new Vue();
Vue.prototype.xss = xss;
Vue.prototype.$splitName = function(val) {
  if (val) {
    let arr = val.split(' ');
    arr = arr.filter(item => {
      return item && item !== ' ';
    });
    arr = arr.join('<br>');
    return arr;
  } else {
    return '';
  }
};
Vue.prototype.$yyyymmdd = function(date, isSecond) {
  var mm = date.getMonth() + 1; // getMonth() is zero-based
  var dd = date.getDate();
  var day = [
    date.getFullYear(),
    (mm > 9 ? '' : '0') + mm,
    (dd > 9 ? '' : '0') + dd
  ].join('-');
  var value = day;
  if (isSecond) {
    var HH = date.getHours();
    var MM = date.getMinutes();
    var ss = date.getSeconds();
    var time = [HH, (MM > 9 ? '' : '0') + MM, (ss > 9 ? '' : 0) + ss].join(':');
    value += ' ' + time;
  }

  return value;
};
Vue.config.productionTip = false;
// Vue.use(ElementUI);
Vue.use(VCharts);
new Vue({
  store,
  router,
  render: h => h(App)
}).$mount('#app');
